type OptionParams = {
  options: any[];
  value: string;
};
/* 获取label,且翻译options */
export const getOptionLabel = (config: OptionParams) => {
  const t = translate("公共模块");
  const result = config.options.find((e) => {
    if (e.value === config.value) {
      return e;
    }
    return undefined;
  });
  if (!t.value) {
    return result.label;
  }
  return result ? t.value?.[result.label] : "";
};
